//
//  UIViewController+SideslipViewController.m
//  WWSideslipViewControllerSample
//
//  Created by Alex on 15-2-11.
//  Copyright (c) 2015年 wangwei. All rights reserved.
//

#import "UIViewController+SideslipViewController.h"
#import <objc/runtime.h>

@implementation UIViewController (SideslipViewController)

static char WWSideslipViewKey;

-(void)setSideViewController:(WWSideslipViewController*)controller
{
    [self willChangeValueForKey:@"WWSideslipViewKey"];
    objc_setAssociatedObject(self,
                             &WWSideslipViewKey,
                             controller,
                             OBJC_ASSOCIATION_ASSIGN);
    [self didChangeValueForKey:@"WWSideslipViewKey"];
}

-(WWSideslipViewController*)sideViewController
{
    return objc_getAssociatedObject(self, &WWSideslipViewKey);
}

-(WWSideslipViewController*)newHomeController
{
    return objc_getAssociatedObject(self, &WWSideslipViewKey);
}

@end
